﻿/***********************************************************************
 * <copyright file="IUnit.cs" company="BUCA JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   LinhMC
 * Email:    linhmc@buca.vn
 * Website:
 * Create Date: Tuesday, October 22, 2013
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System.Collections.Generic;
using BusinessObjects.BussinessDictionary;

namespace DataObjects.StandartInterfaces.Dictionary
{
    /// <summary>
    /// Defines methods to access Unit
    /// </summary>
    /// <remarks>
    /// This is a database-independent interface. Implementations are database specific
    /// </remarks>
    public interface IUnitDao
    {
        List<Unit> GetUnits(int isActive);


        List<Unit> GetUnits();
        /// <summary>
        /// Gets the units by parent identifier.
        /// </summary>
        /// <param name="parentId">The parent identifier.</param>
        /// <returns></returns>
        IList<Unit> GetUnitsByParentId(int parentId);
        /// <summary>
        /// Gets the sequence.
        /// </summary>
        /// <returns></returns>
        long GetSequence();
        /// <summary>
        /// Gets the paged.
        /// </summary>
        /// <param name="unitId">The unit identifier.</param>
        /// <param name="currentPage">The current page.</param>
        /// <returns></returns>
        List<Unit> GetPaged(int unitId, int currentPage); 

        /// <summary>
        /// Gets the size of the page.
        /// </summary>
        /// <param name="unitId">The unit identifier.</param>
        
        /// <returns></returns>
        int GetPageSize();

        

          /// <summary>
        /// Gets the units by unit.
        /// </summary>
        /// <param name="unitId">The unit identifier.</param>
        /// <returns></returns>
        Unit GetUnit(int unitId);

        /// <summary>
        /// Gets the units by unit.
        /// </summary>
        /// <param name="unitId">The unit identifier.</param>
        /// <returns></returns>
        Unit GetUnitByUserID(int userId);  

        
        /// <summary>
        /// Inserts the unit.
        /// </summary>
        /// <param name="unit">The unit.</param>
        string InsertUnit(Unit unit);

        /// <summary>
        /// Updates the unit.
        /// </summary>
        /// <param name="unit">The unit.</param>
        string UpdateUnit(Unit unit);

        /// <summary>
        /// Deletes the unit.
        /// </summary>
        /// <param name="unit">The unit.</param>
        string DeleteUnit(Unit unit);
    }
}
